home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume3 / g-format / part3 < prev    next >
Encoding:
Internet Message Format  |  1986-11-30  |  40.6 KB

  1. From: J.D.Aplevich <genrad!decvax!watmath!watdcsu!aplevich>
  2. Subject: G-format compilers for Ultrix/Unix Vaxes (3 of 4)
  3. Newsgroups: mod.sources
  4. Approved: jpn@panda.UUCP
  5.  
  6. Mod.sources:  Volume 3, Issue 39
  7. Submitted by: J.D.Aplevich <decvax!watmath!watdcsu!aplevich>
  8.  
  9.  
  10. #!/bin/sh
  11. # This is a shell archive, meaning:
  12. # 1. Remove everything above the #!/bin/sh line.
  13. # 2. Save the resulting text in a file.
  14. # 3. Execute the file with /bin/sh (not csh) to create the files:
  15. #    gfloat
  16. # This archive created: Wed Oct 30 10:33:37 1985
  17. export PATH; PATH=/bin:$PATH
  18. if test ! -d 'gfloat'
  19. then
  20.     mkdir 'gfloat'
  21. fi
  22. cd 'gfloat'
  23. if test ! -d 'f77'
  24. then
  25.     mkdir 'f77'
  26. fi
  27. cd 'f77'
  28. if test ! -d 'src'
  29. then
  30.     mkdir 'src'
  31. fi
  32. cd 'src'
  33. if test ! -d 'f77pass1'
  34. then
  35.     mkdir 'f77pass1'
  36. fi
  37. cd 'f77pass1'
  38. if test -f 'bb.c.diff'
  39. then
  40.     echo shar: over-writing existing file "'bb.c.diff'"
  41. fi
  42. cat << \SHAR_EOF > 'bb.c.diff'
  43. *** ../f77/src/f77pass1/bb.c.orig    Tue Oct 29 15:15:44 1985
  44. --- ../f77/src/f77pass1/bb.c    Tue Oct 29 15:22:15 1985
  45. ***************
  46. *** 717,722
  47.                    }
  48.                 else  if( ISINT(type) )
  49.                      fprintf(diagfile," ci= %d\n",p->constblock.const.ci); 
  50.                 else if( ISREAL(type) )
  51.                      fprintf(diagfile," cd[0]= %e\n",p->constblock.const.cd[0]);
  52.                 else fprintf(diagfile," cd[0]= %e  cd[1]= %e\n",
  53.  
  54. --- 717,726 -----
  55.                    }
  56.                 else  if( ISINT(type) )
  57.                      fprintf(diagfile," ci= %d\n",p->constblock.const.ci); 
  58. + #ifdef GFLOAT
  59. +               else if( ISREAL(type) && type==TYREAL)
  60. +                    fprintf(diagfile," cr[0]= %e\n",p->constblock.const.cr[0]);
  61. + #endif GFLOAT
  62.                 else if( ISREAL(type) )
  63.                      fprintf(diagfile," cd[0]= %e\n",p->constblock.const.cd[0]);
  64.                 else fprintf(diagfile," cd[0]= %e  cd[1]= %e\n",
  65. SHAR_EOF
  66. chmod +x 'bb.c.diff'
  67. if test -f 'conv.c.diff'
  68. then
  69.     echo shar: over-writing existing file "'conv.c.diff'"
  70. fi
  71. cat << \SHAR_EOF > 'conv.c.diff'
  72. *** ../f77/src/f77pass1/conv.c.orig    Tue Oct 29 15:15:46 1985
  73. --- ../f77/src/f77pass1/conv.c    Tue Oct 29 15:22:23 1985
  74. ***************
  75. *** 53,59
  76.   
  77.   
  78.   /*  The following constants are used to check the limits of  */
  79. ! /*  conversions.  Dmaxword is the largest double precision   */
  80.   /*  number which can be converted to a two-byte integer      */
  81.   /*  without overflow.  Dminword is the smallest double       */
  82.   /*  precision value which can be converted to a two-byte     */
  83.  
  84. --- 53,61 -----
  85.   
  86.   
  87.   /*  The following constants are used to check the limits of  */
  88. ! /*  conversions.                                 */
  89. ! /*  Dmaxword is the largest double precision                    */
  90.   /*  number which can be converted to a two-byte integer      */
  91.   /*  without overflow.  Dminword is the smallest double       */
  92.   /*  precision value which can be converted to a two-byte     */
  93. ***************
  94. *** 57,66
  95.   /*  number which can be converted to a two-byte integer      */
  96.   /*  without overflow.  Dminword is the smallest double       */
  97.   /*  precision value which can be converted to a two-byte     */
  98. ! /*  integer without overflow.  Dmaxint and dminint are the   */
  99. ! /*  analogous values for four-byte integers.                 */
  100.   LOCAL long dmaxword[] = { 0xfeff47ff, 0xffffffff };
  101.   LOCAL long dminword[] = { 0x00ffc800, 0xffffffff };
  102.   
  103.  
  104. --- 59,66 -----
  105.   /*  number which can be converted to a two-byte integer      */
  106.   /*  without overflow.  Dminword is the smallest double       */
  107.   /*  precision value which can be converted to a two-byte     */
  108. ! /*  integer without overflow.                                */
  109. ! #ifndef GFLOAT
  110.   LOCAL long dmaxword[] = { 0xfeff47ff, 0xffffffff };
  111.   LOCAL long dminword[] = { 0x00ffc800, 0xffffffff };
  112.   #else GFLOAT
  113. ***************
  114. *** 63,68
  115.   
  116.   LOCAL long dmaxword[] = { 0xfeff47ff, 0xffffffff };
  117.   LOCAL long dminword[] = { 0x00ffc800, 0xffffffff };
  118.   
  119.   LOCAL long dmaxint[]  = { 0xffff4fff, 0xfffffeff };
  120.   LOCAL long dminint[]  = { 0x0000d000, 0xffff00ff };
  121.  
  122. --- 63,72 -----
  123.   #ifndef GFLOAT
  124.   LOCAL long dmaxword[] = { 0xfeff47ff, 0xffffffff };
  125.   LOCAL long dminword[] = { 0x00ffc800, 0xffffffff };
  126. + #else GFLOAT
  127. + LOCAL long dmaxword[] = { 0xffdf40ff, 0xffffffff };
  128. + LOCAL long dminword[] = { 0x0010c100, 0x00000000 };
  129. + #endif GFLOAT
  130.   
  131.   /*  Dmaxint and dminint are the limits for double values     */
  132.   /*  converted to four-byte integers.                         */
  133. ***************
  134. *** 64,69
  135.   LOCAL long dmaxword[] = { 0xfeff47ff, 0xffffffff };
  136.   LOCAL long dminword[] = { 0x00ffc800, 0xffffffff };
  137.   
  138.   LOCAL long dmaxint[]  = { 0xffff4fff, 0xfffffeff };
  139.   LOCAL long dminint[]  = { 0x0000d000, 0xffff00ff };
  140.   
  141.  
  142. --- 68,79 -----
  143.   LOCAL long dminword[] = { 0x0010c100, 0x00000000 };
  144.   #endif GFLOAT
  145.   
  146. + /*  Dmaxint and dminint are the limits for double values     */
  147. + /*  converted to four-byte integers.                         */
  148. + #ifdef GFLOAT
  149. + LOCAL long dmaxint[]  = { 0xffff41ff, 0xffffffdf };
  150. + LOCAL long dminint[]  = { 0x0000c200, 0xffff0010 };
  151. + #else GFLOAT
  152.   LOCAL long dmaxint[]  = { 0xffff4fff, 0xfffffeff };
  153.   LOCAL long dminint[]  = { 0x0000d000, 0xffff00ff };
  154.   #endif GFLOAT
  155. ***************
  156. *** 66,71
  157.   
  158.   LOCAL long dmaxint[]  = { 0xffff4fff, 0xfffffeff };
  159.   LOCAL long dminint[]  = { 0x0000d000, 0xffff00ff };
  160.   
  161.   LOCAL long dmaxreal[] = { 0xffff7fff, 0xffff7fff };
  162.   LOCAL long dminreal[] = { 0xffffffff, 0xffff7fff };
  163.  
  164. --- 76,82 -----
  165.   #else GFLOAT
  166.   LOCAL long dmaxint[]  = { 0xffff4fff, 0xfffffeff };
  167.   LOCAL long dminint[]  = { 0x0000d000, 0xffff00ff };
  168. + #endif GFLOAT
  169.   
  170.   #ifndef GFLOAT
  171.   LOCAL long dmaxreal[] = { 0xffff7fff, 0xffff7fff };
  172. ***************
  173. *** 67,72
  174.   LOCAL long dmaxint[]  = { 0xffff4fff, 0xfffffeff };
  175.   LOCAL long dminint[]  = { 0x0000d000, 0xffff00ff };
  176.   
  177.   LOCAL long dmaxreal[] = { 0xffff7fff, 0xffff7fff };
  178.   LOCAL long dminreal[] = { 0xffffffff, 0xffff7fff };
  179.   
  180.  
  181. --- 78,84 -----
  182.   LOCAL long dminint[]  = { 0x0000d000, 0xffff00ff };
  183.   #endif GFLOAT
  184.   
  185. + #ifndef GFLOAT
  186.   LOCAL long dmaxreal[] = { 0xffff7fff, 0xffff7fff };
  187.   LOCAL long dminreal[] = { 0xffffffff, 0xffff7fff };
  188.   #else GFLOAT
  189. ***************
  190. *** 69,74
  191.   
  192.   LOCAL long dmaxreal[] = { 0xffff7fff, 0xffff7fff };
  193.   LOCAL long dminreal[] = { 0xffffffff, 0xffff7fff };
  194.   
  195.   
  196.   
  197.  
  198. --- 81,89 -----
  199.   #ifndef GFLOAT
  200.   LOCAL long dmaxreal[] = { 0xffff7fff, 0xffff7fff };
  201.   LOCAL long dminreal[] = { 0xffffffff, 0xffff7fff };
  202. + #else GFLOAT
  203. + LOCAL long dmaxreal[] = { 0xffff47f7, 0xffffffff };
  204. + LOCAL long dminreal[] = { 0xffffc7f7, 0xffffffff };
  205.   
  206.   /*  Fmaxword and fminword are limits for float to short.     */
  207.   LOCAL long fmaxword[] = { 0xff7f47ff };
  208. ***************
  209. *** 70,75
  210.   LOCAL long dmaxreal[] = { 0xffff7fff, 0xffff7fff };
  211.   LOCAL long dminreal[] = { 0xffffffff, 0xffff7fff };
  212.   
  213.   
  214.   
  215.   /*  The routines which follow are used to convert  */
  216.  
  217. --- 85,98 -----
  218.   LOCAL long dmaxreal[] = { 0xffff47f7, 0xffffffff };
  219.   LOCAL long dminreal[] = { 0xffffc7f7, 0xffffffff };
  220.   
  221. + /*  Fmaxword and fminword are limits for float to short.     */
  222. + LOCAL long fmaxword[] = { 0xff7f47ff };
  223. + LOCAL long fminword[] = { 0x00ffc800 };
  224. + /*  Fmaxint and fminint are the limits for float to int.     */
  225. + LOCAL long fmaxint[]  = { 0xffff4fff };
  226. + LOCAL long fminint[]  = { 0x0000d000 };
  227. + #endif GFLOAT
  228.   
  229.   
  230.   /*  The routines which follow are used to convert  */
  231. ***************
  232. *** 188,193
  233.     register long *rp;
  234.     register double *minp;
  235.     register double *maxp;
  236.     realvalue x;
  237.   
  238.     switch (cp->vtype)
  239.  
  240. --- 211,220 -----
  241.     register long *rp;
  242.     register double *minp;
  243.     register double *maxp;
  244. + #ifdef GFLOAT
  245. +   register float *minpf;
  246. +   register float *maxpf;
  247. + #endif GFLOAT
  248.     realvalue x;
  249.   
  250.     switch (cp->vtype)
  251. ***************
  252. *** 222,227
  253.         break;
  254.   
  255.       case TYREAL:
  256.       case TYDREAL:
  257.       case TYCOMPLEX:
  258.       case TYDCOMPLEX:
  259.  
  260. --- 249,255 -----
  261.         break;
  262.   
  263.       case TYREAL:
  264. + #ifndef GFLOAT
  265.       case TYDREAL:
  266.   #endif GFLOAT
  267.       case TYCOMPLEX:
  268. ***************
  269. *** 223,228
  270.   
  271.       case TYREAL:
  272.       case TYDREAL:
  273.       case TYCOMPLEX:
  274.       case TYDCOMPLEX:
  275.         minp = (double *) dminword;
  276.  
  277. --- 251,257 -----
  278.       case TYREAL:
  279.   #ifndef GFLOAT
  280.       case TYDREAL:
  281. + #endif GFLOAT
  282.       case TYCOMPLEX:
  283.   #ifdef GFLOAT
  284.         minpf = (float *) fminword;
  285. ***************
  286. *** 224,229
  287.       case TYREAL:
  288.       case TYDREAL:
  289.       case TYCOMPLEX:
  290.       case TYDCOMPLEX:
  291.         minp = (double *) dminword;
  292.         maxp = (double *) dmaxword;
  293.  
  294. --- 253,290 -----
  295.       case TYDREAL:
  296.   #endif GFLOAT
  297.       case TYCOMPLEX:
  298. + #ifdef GFLOAT
  299. +       minpf = (float *) fminword;
  300. +       maxpf = (float *) fmaxword;
  301. +       rp = (long *) &(cp->const.cr[0]);
  302. +       x.q.word1 = rp[0];
  303. +       if (x.f.sign == 1 && x.f.exp == 0)
  304. +     {
  305. +       if (badvalue <= 1)
  306. +         {
  307. +           badvalue = 2;
  308. +           err(reserved);
  309. +         }
  310. +       p = errnode();
  311. +     }
  312. +       else if ((float) x.q.word1 >= *minpf && (float) x.q.word1 <= *maxpf)
  313. +     {
  314. +       p = (expptr) mkconst(TYSHORT);
  315. +       p->constblock.const.ci = x.q.word1;
  316. +     }
  317. +       else
  318. +     {
  319. +       if (badvalue <= 1)
  320. +         {
  321. +           badvalue = 2;
  322. +           err(toobig);
  323. +         }
  324. +       p = errnode();
  325. +     }
  326. +       break;
  327. +     case TYDREAL:
  328. + #endif GFLOAT
  329.       case TYDCOMPLEX:
  330.         minp = (double *) dminword;
  331.         maxp = (double *) dmaxword;
  332. ***************
  333. *** 230,235
  334.         rp = (long *) &(cp->const.cd[0]);
  335.         x.q.word1 = rp[0];
  336.         x.q.word2 = rp[1];
  337.         if (x.f.sign == 1 && x.f.exp == 0)
  338.       {
  339.         if (badvalue <= 1)
  340.  
  341. --- 291,297 -----
  342.         rp = (long *) &(cp->const.cd[0]);
  343.         x.q.word1 = rp[0];
  344.         x.q.word2 = rp[1];
  345. + #ifndef GFLOAT
  346.         if (x.f.sign == 1 && x.f.exp == 0)
  347.   #else GFLOAT
  348.         if (x.g.sign == 1 && x.g.exp == 0)
  349. ***************
  350. *** 231,236
  351.         x.q.word1 = rp[0];
  352.         x.q.word2 = rp[1];
  353.         if (x.f.sign == 1 && x.f.exp == 0)
  354.       {
  355.         if (badvalue <= 1)
  356.           {
  357.  
  358. --- 293,301 -----
  359.         x.q.word2 = rp[1];
  360.   #ifndef GFLOAT
  361.         if (x.f.sign == 1 && x.f.exp == 0)
  362. + #else GFLOAT
  363. +       if (x.g.sign == 1 && x.g.exp == 0)
  364. + #endif GFLOAT
  365.       {
  366.         if (badvalue <= 1)
  367.           {
  368. ***************
  369. *** 302,307
  370.     register long *rp;
  371.     register double *minp;
  372.     register double *maxp;
  373.     realvalue x;
  374.   
  375.     switch (cp->vtype)
  376.  
  377. --- 367,376 -----
  378.     register long *rp;
  379.     register double *minp;
  380.     register double *maxp;
  381. + #ifdef GFLOAT
  382. +   register float *minpf;
  383. +   register float *maxpf;
  384. + #endif GFLOAT
  385.     realvalue x;
  386.   
  387.     switch (cp->vtype)
  388. ***************
  389. *** 323,328
  390.         break;
  391.   
  392.       case TYREAL:
  393.       case TYDREAL:
  394.       case TYCOMPLEX:
  395.       case TYDCOMPLEX:
  396.  
  397. --- 392,398 -----
  398.         break;
  399.   
  400.       case TYREAL:
  401. + #ifndef GFLOAT
  402.       case TYDREAL:
  403.   #endif GFLOAT
  404.       case TYCOMPLEX:
  405. ***************
  406. *** 324,329
  407.   
  408.       case TYREAL:
  409.       case TYDREAL:
  410.       case TYCOMPLEX:
  411.       case TYDCOMPLEX:
  412.         minp = (double *) dminint;
  413.  
  414. --- 394,400 -----
  415.       case TYREAL:
  416.   #ifndef GFLOAT
  417.       case TYDREAL:
  418. + #endif GFLOAT
  419.       case TYCOMPLEX:
  420.   #ifdef GFLOAT
  421.         minpf = (float *) fminint;
  422. ***************
  423. *** 325,330
  424.       case TYREAL:
  425.       case TYDREAL:
  426.       case TYCOMPLEX:
  427.       case TYDCOMPLEX:
  428.         minp = (double *) dminint;
  429.         maxp = (double *) dmaxint;
  430.  
  431. --- 396,432 -----
  432.       case TYDREAL:
  433.   #endif GFLOAT
  434.       case TYCOMPLEX:
  435. + #ifdef GFLOAT
  436. +       minpf = (float *) fminint;
  437. +       maxpf = (float *) fmaxint;
  438. +       x.q.word1 = *((long *) &cp->const.cr[0]);
  439. +       if (x.f.sign == 1 && x.f.exp == 0)
  440. +     {
  441. +       if (badvalue <= 1)
  442. +         {
  443. +           badvalue = 2;
  444. +           err(reserved);
  445. +         }
  446. +       p = errnode();
  447. +     }
  448. +       else if (cp->const.cr[0] >= *minpf && cp->const.cr[0] <= *maxpf)
  449. +     {
  450. +       p = (expptr) mkconst(TYLONG);
  451. +       p->constblock.const.ci = cp->const.cr[0];
  452. +     }
  453. +       else
  454. +     {
  455. +       if (badvalue <= 1)
  456. +         {
  457. +           badvalue = 2;
  458. +           err(toobig);
  459. +         }
  460. +       p = errnode();
  461. +     }
  462. +       break;
  463. +     case TYDREAL:
  464. + #endif GFLOAT
  465.       case TYDCOMPLEX:
  466.         minp = (double *) dminint;
  467.         maxp = (double *) dmaxint;
  468. ***************
  469. *** 331,336
  470.         rp = (long *) &(cp->const.cd[0]);
  471.         x.q.word1 = rp[0];
  472.         x.q.word2 = rp[1];
  473.         if (x.f.sign == 1 && x.f.exp == 0)
  474.       {
  475.         if (badvalue <= 1)
  476.  
  477. --- 433,439 -----
  478.         rp = (long *) &(cp->const.cd[0]);
  479.         x.q.word1 = rp[0];
  480.         x.q.word2 = rp[1];
  481. + #ifndef GFLOAT
  482.         if (x.f.sign == 1 && x.f.exp == 0)
  483.   #else GFLOAT
  484.         if (x.g.sign == 1 && x.g.exp == 0)
  485. ***************
  486. *** 332,337
  487.         x.q.word1 = rp[0];
  488.         x.q.word2 = rp[1];
  489.         if (x.f.sign == 1 && x.f.exp == 0)
  490.       {
  491.         if (badvalue <= 1)
  492.           {
  493.  
  494. --- 435,443 -----
  495.         x.q.word2 = rp[1];
  496.   #ifndef GFLOAT
  497.         if (x.f.sign == 1 && x.f.exp == 0)
  498. + #else GFLOAT
  499. +       if (x.g.sign == 1 && x.g.exp == 0)
  500. + #endif GFLOAT
  501.       {
  502.         if (badvalue <= 1)
  503.           {
  504. ***************
  505. *** 403,408
  506.     register double *minp;
  507.     register double *maxp;
  508.     realvalue x;
  509.     float y;
  510.   
  511.     switch (cp->vtype)
  512.  
  513. --- 509,515 -----
  514.     register double *minp;
  515.     register double *maxp;
  516.     realvalue x;
  517. + #ifndef GFLOAT
  518.     float y;
  519.   #endif GFLOAT
  520.   
  521. ***************
  522. *** 404,409
  523.     register double *maxp;
  524.     realvalue x;
  525.     float y;
  526.   
  527.     switch (cp->vtype)
  528.       {
  529.  
  530. --- 511,517 -----
  531.     realvalue x;
  532.   #ifndef GFLOAT
  533.     float y;
  534. + #endif GFLOAT
  535.   
  536.     switch (cp->vtype)
  537.       {
  538. ***************
  539. *** 418,423
  540.       case TYSHORT:
  541.       case TYLONG:
  542.         p = (expptr) mkconst(TYREAL);
  543.         p->constblock.const.cd[0] = cp->const.ci;
  544.         break;
  545.   
  546.  
  547. --- 526,532 -----
  548.       case TYSHORT:
  549.       case TYLONG:
  550.         p = (expptr) mkconst(TYREAL);
  551. + #ifndef GFLOAT
  552.         p->constblock.const.cd[0] = cp->const.ci;
  553.   #else GFLOAT
  554.         p->constblock.const.cr[0] = cp->const.ci;
  555. ***************
  556. *** 419,424
  557.       case TYLONG:
  558.         p = (expptr) mkconst(TYREAL);
  559.         p->constblock.const.cd[0] = cp->const.ci;
  560.         break;
  561.   
  562.       case TYREAL:
  563.  
  564. --- 528,536 -----
  565.         p = (expptr) mkconst(TYREAL);
  566.   #ifndef GFLOAT
  567.         p->constblock.const.cd[0] = cp->const.ci;
  568. + #else GFLOAT
  569. +       p->constblock.const.cr[0] = cp->const.ci;
  570. + #endif GFLOAT
  571.         break;
  572.   
  573.       case TYREAL:
  574. ***************
  575. *** 422,427
  576.         break;
  577.   
  578.       case TYREAL:
  579.       case TYDREAL:
  580.       case TYCOMPLEX:
  581.       case TYDCOMPLEX:
  582.  
  583. --- 534,540 -----
  584.         break;
  585.   
  586.       case TYREAL:
  587. + #ifndef GFLOAT
  588.       case TYDREAL:
  589.   #endif GFLOAT
  590.       case TYCOMPLEX:
  591. ***************
  592. *** 423,428
  593.   
  594.       case TYREAL:
  595.       case TYDREAL:
  596.       case TYCOMPLEX:
  597.       case TYDCOMPLEX:
  598.         minp = (double *) dminreal;
  599.  
  600. --- 536,542 -----
  601.       case TYREAL:
  602.   #ifndef GFLOAT
  603.       case TYDREAL:
  604. + #endif GFLOAT
  605.       case TYCOMPLEX:
  606.   #ifdef GFLOAT
  607.         p = (expptr) mkconst(TYREAL);
  608. ***************
  609. *** 424,429
  610.       case TYREAL:
  611.       case TYDREAL:
  612.       case TYCOMPLEX:
  613.       case TYDCOMPLEX:
  614.         minp = (double *) dminreal;
  615.         maxp = (double *) dmaxreal;
  616.  
  617. --- 538,550 -----
  618.       case TYDREAL:
  619.   #endif GFLOAT
  620.       case TYCOMPLEX:
  621. + #ifdef GFLOAT
  622. +       p = (expptr) mkconst(TYREAL);
  623. +       p->constblock.const.cr[0] = cp->const.cr[0];
  624. +       break;
  625. +     case TYDREAL:
  626. + #endif GFLOAT
  627.       case TYDCOMPLEX:
  628.         minp = (double *) dminreal;
  629.         maxp = (double *) dmaxreal;
  630. ***************
  631. *** 430,435
  632.         rp = (long *) &(cp->const.cd[0]);
  633.         x.q.word1 = rp[0];
  634.         x.q.word2 = rp[1];
  635.         if (x.f.sign == 1 && x.f.exp == 0)
  636.       {
  637.         p = (expptr) mkconst(TYREAL);
  638.  
  639. --- 551,557 -----
  640.         rp = (long *) &(cp->const.cd[0]);
  641.         x.q.word1 = rp[0];
  642.         x.q.word2 = rp[1];
  643. + #ifndef GFLOAT
  644.         if (x.f.sign == 1 && x.f.exp == 0)
  645.   #else GFLOAT
  646.         if (x.g.sign == 1 && x.g.exp == 0)
  647. ***************
  648. *** 431,436
  649.         x.q.word1 = rp[0];
  650.         x.q.word2 = rp[1];
  651.         if (x.f.sign == 1 && x.f.exp == 0)
  652.       {
  653.         p = (expptr) mkconst(TYREAL);
  654.         rp = (long *) &(p->constblock.const.cd[0]);
  655.  
  656. --- 553,561 -----
  657.         x.q.word2 = rp[1];
  658.   #ifndef GFLOAT
  659.         if (x.f.sign == 1 && x.f.exp == 0)
  660. + #else GFLOAT
  661. +       if (x.g.sign == 1 && x.g.exp == 0)
  662. + #endif GFLOAT
  663.       {
  664.         p = (expptr) mkconst(TYREAL);
  665.   #ifndef GFLOAT
  666. ***************
  667. *** 433,438
  668.         if (x.f.sign == 1 && x.f.exp == 0)
  669.       {
  670.         p = (expptr) mkconst(TYREAL);
  671.         rp = (long *) &(p->constblock.const.cd[0]);
  672.         rp[0] = x.q.word1;
  673.       }
  674.  
  675. --- 558,564 -----
  676.   #endif GFLOAT
  677.       {
  678.         p = (expptr) mkconst(TYREAL);
  679. + #ifndef GFLOAT
  680.         rp = (long *) &(p->constblock.const.cd[0]);
  681.         rp[0] = x.q.word1;
  682.   #else GFLOAT
  683. ***************
  684. *** 435,440
  685.         p = (expptr) mkconst(TYREAL);
  686.         rp = (long *) &(p->constblock.const.cd[0]);
  687.         rp[0] = x.q.word1;
  688.       }
  689.         else if (x.d >= *minp && x.d <= *maxp)
  690.       {
  691.  
  692. --- 561,570 -----
  693.   #ifndef GFLOAT
  694.         rp = (long *) &(p->constblock.const.cd[0]);
  695.         rp[0] = x.q.word1;
  696. + #else GFLOAT
  697. + /* Gfloat: Assume that IEEE standard hardware handles exceptions */
  698. +       p->constblock.const.cr[0] = x.d;
  699. + #endif GFLOAT
  700.       }
  701.         else if (x.d >= *minp && x.d <= *maxp)
  702.       {
  703. ***************
  704. *** 439,444
  705.         else if (x.d >= *minp && x.d <= *maxp)
  706.       {
  707.         p = (expptr) mkconst(TYREAL);
  708.         y = x.d;
  709.         p->constblock.const.cd[0] = y;
  710.       }
  711.  
  712. --- 569,575 -----
  713.         else if (x.d >= *minp && x.d <= *maxp)
  714.       {
  715.         p = (expptr) mkconst(TYREAL);
  716. + #ifndef GFLOAT
  717.         y = x.d;
  718.         p->constblock.const.cd[0] = y;
  719.   #else GFLOAT
  720. ***************
  721. *** 441,446
  722.         p = (expptr) mkconst(TYREAL);
  723.         y = x.d;
  724.         p->constblock.const.cd[0] = y;
  725.       }
  726.         else
  727.       {
  728.  
  729. --- 572,580 -----
  730.   #ifndef GFLOAT
  731.         y = x.d;
  732.         p->constblock.const.cd[0] = y;
  733. + #else GFLOAT
  734. +       p->constblock.const.cr[0] = x.d;
  735. + #endif GFLOAT
  736.       }
  737.         else
  738.       {
  739. ***************
  740. *** 517,522
  741.         p->constblock.const.cd[0] = cp->const.ci;
  742.         break;
  743.   
  744.       case TYREAL:
  745.       case TYDREAL:
  746.       case TYCOMPLEX:
  747.  
  748. --- 651,657 -----
  749.         p->constblock.const.cd[0] = cp->const.ci;
  750.         break;
  751.   
  752. + #ifndef GFLOAT
  753.       case TYREAL:
  754.       case TYCOMPLEX:
  755.   #endif GFLOAT
  756. ***************
  757. *** 518,524
  758.         break;
  759.   
  760.       case TYREAL:
  761. -     case TYDREAL:
  762.       case TYCOMPLEX:
  763.       case TYDCOMPLEX:
  764.         p = (expptr) mkconst(TYDREAL);
  765.  
  766. --- 653,658 -----
  767.   
  768.   #ifndef GFLOAT
  769.       case TYREAL:
  770.       case TYCOMPLEX:
  771.   #endif GFLOAT
  772.       case TYDREAL:
  773. ***************
  774. *** 520,525
  775.       case TYREAL:
  776.       case TYDREAL:
  777.       case TYCOMPLEX:
  778.       case TYDCOMPLEX:
  779.         p = (expptr) mkconst(TYDREAL);
  780.         longp = (long *) &(cp->const.cd[0]);
  781.  
  782. --- 654,661 -----
  783.   #ifndef GFLOAT
  784.       case TYREAL:
  785.       case TYCOMPLEX:
  786. + #endif GFLOAT
  787. +     case TYDREAL:
  788.       case TYDCOMPLEX:
  789.         p = (expptr) mkconst(TYDREAL);
  790.   #ifndef GFLOAT
  791. ***************
  792. *** 522,527
  793.       case TYCOMPLEX:
  794.       case TYDCOMPLEX:
  795.         p = (expptr) mkconst(TYDREAL);
  796.         longp = (long *) &(cp->const.cd[0]);
  797.         rp = (long *) &(p->constblock.const.cd[0]);
  798.         rp[0] = longp[0];
  799.  
  800. --- 658,664 -----
  801.       case TYDREAL:
  802.       case TYDCOMPLEX:
  803.         p = (expptr) mkconst(TYDREAL);
  804. + #ifndef GFLOAT
  805.         longp = (long *) &(cp->const.cd[0]);
  806.         rp = (long *) &(p->constblock.const.cd[0]);
  807.         rp[0] = longp[0];
  808. ***************
  809. *** 526,531
  810.         rp = (long *) &(p->constblock.const.cd[0]);
  811.         rp[0] = longp[0];
  812.         rp[1] = longp[1];
  813.         break;
  814.   
  815.       case TYLOGICAL:
  816.  
  817. --- 663,671 -----
  818.         rp = (long *) &(p->constblock.const.cd[0]);
  819.         rp[0] = longp[0];
  820.         rp[1] = longp[1];
  821. + #else GFLOAT
  822. +       p->constblock.const.cd[0] = cp->const.cd[0];
  823. + #endif GFLOAT
  824.         break;
  825.   
  826.   #ifdef GFLOAT
  827. ***************
  828. *** 528,533
  829.         rp[1] = longp[1];
  830.         break;
  831.   
  832.       case TYLOGICAL:
  833.         if (badvalue <= 1)
  834.       {
  835.  
  836. --- 668,681 -----
  837.   #endif GFLOAT
  838.         break;
  839.   
  840. + #ifdef GFLOAT
  841. +     case TYREAL:
  842. +     case TYCOMPLEX:
  843. +       p = (expptr) mkconst(TYDREAL);
  844. +       p->constblock.const.cd[0] = cp->const.cr[0];
  845. +       break;
  846. + #endif GFLOAT
  847.       case TYLOGICAL:
  848.         if (badvalue <= 1)
  849.       {
  850. ***************
  851. *** 576,581
  852.     register long *rp;
  853.     register double *minp;
  854.     register double *maxp;
  855.     realvalue re, im;
  856.     int overflow;
  857.     float x;
  858.  
  859. --- 724,733 -----
  860.     register long *rp;
  861.     register double *minp;
  862.     register double *maxp;
  863. + #ifdef GFLOAT
  864. +   register float *minpf;
  865. +   register float *maxpf;
  866. + #endif GFLOAT
  867.     realvalue re, im;
  868.     int overflow;
  869.     float x;
  870. ***************
  871. *** 598,603
  872.         break;
  873.   
  874.       case TYREAL:
  875.       case TYDREAL:
  876.       case TYCOMPLEX:
  877.       case TYDCOMPLEX:
  878.  
  879. --- 750,756 -----
  880.         break;
  881.   
  882.       case TYREAL:
  883. + #ifndef GFLOAT
  884.       case TYDREAL:
  885.   #endif GFLOAT
  886.       case TYCOMPLEX:
  887. ***************
  888. *** 599,604
  889.   
  890.       case TYREAL:
  891.       case TYDREAL:
  892.       case TYCOMPLEX:
  893.       case TYDCOMPLEX:
  894.         overflow = 0;
  895.  
  896. --- 752,758 -----
  897.       case TYREAL:
  898.   #ifndef GFLOAT
  899.       case TYDREAL:
  900. + #endif GFLOAT
  901.       case TYCOMPLEX:
  902.   #ifdef GFLOAT
  903.         overflow = 0;
  904. ***************
  905. *** 600,605
  906.       case TYREAL:
  907.       case TYDREAL:
  908.       case TYCOMPLEX:
  909.       case TYDCOMPLEX:
  910.         overflow = 0;
  911.         minp = (double *) dminreal;
  912.  
  913. --- 754,768 -----
  914.       case TYDREAL:
  915.   #endif GFLOAT
  916.       case TYCOMPLEX:
  917. + #ifdef GFLOAT
  918. +       overflow = 0;
  919. +       p = (expptr) mkconst(TYCOMPLEX);
  920. +       p->constblock.const.cr[0] = cp->const.cr[0];
  921. +       p->constblock.const.cr[1] = cp->const.cr[1];
  922. +       break;
  923. +     case TYDREAL:
  924. + #endif GFLOAT
  925.       case TYDCOMPLEX:
  926.         overflow = 0;
  927.         minp = (double *) dminreal;
  928. ***************
  929. *** 609,614
  930.         re.q.word2 = rp[1];
  931.         im.q.word1 = rp[2];
  932.         im.q.word2 = rp[3];
  933.         if (((re.f.sign == 0 || re.f.exp != 0) &&
  934.          (re.d < *minp || re.d > *maxp))       ||
  935.         ((im.f.sign == 0 || re.f.exp != 0) &&
  936.  
  937. --- 772,778 -----
  938.         re.q.word2 = rp[1];
  939.         im.q.word1 = rp[2];
  940.         im.q.word2 = rp[3];
  941. + #ifndef GFLOAT
  942.         if (((re.f.sign == 0 || re.f.exp != 0) &&
  943.   #else GFLOAT
  944.         if (((re.g.sign == 0 || re.g.exp != 0) &&
  945. ***************
  946. *** 610,615
  947.         im.q.word1 = rp[2];
  948.         im.q.word2 = rp[3];
  949.         if (((re.f.sign == 0 || re.f.exp != 0) &&
  950.          (re.d < *minp || re.d > *maxp))       ||
  951.         ((im.f.sign == 0 || re.f.exp != 0) &&
  952.          (im.d < *minp || re.d > *maxp)))
  953.  
  954. --- 774,782 -----
  955.         im.q.word2 = rp[3];
  956.   #ifndef GFLOAT
  957.         if (((re.f.sign == 0 || re.f.exp != 0) &&
  958. + #else GFLOAT
  959. +       if (((re.g.sign == 0 || re.g.exp != 0) &&
  960. + #endif GFLOAT
  961.          (re.d < *minp || re.d > *maxp))       ||
  962.   #ifndef GFLOAT
  963.         ((im.f.sign == 0 || re.f.exp != 0) &&
  964. ***************
  965. *** 611,616
  966.         im.q.word2 = rp[3];
  967.         if (((re.f.sign == 0 || re.f.exp != 0) &&
  968.          (re.d < *minp || re.d > *maxp))       ||
  969.         ((im.f.sign == 0 || re.f.exp != 0) &&
  970.          (im.d < *minp || re.d > *maxp)))
  971.       {
  972.  
  973. --- 778,784 -----
  974.         if (((re.g.sign == 0 || re.g.exp != 0) &&
  975.   #endif GFLOAT
  976.          (re.d < *minp || re.d > *maxp))       ||
  977. + #ifndef GFLOAT
  978.         ((im.f.sign == 0 || re.f.exp != 0) &&
  979.   #else GFLOAT
  980.         ((im.g.sign == 0 || re.g.exp != 0) &&
  981. ***************
  982. *** 612,617
  983.         if (((re.f.sign == 0 || re.f.exp != 0) &&
  984.          (re.d < *minp || re.d > *maxp))       ||
  985.         ((im.f.sign == 0 || re.f.exp != 0) &&
  986.          (im.d < *minp || re.d > *maxp)))
  987.       {
  988.         if (badvalue <= 1)
  989.  
  990. --- 780,788 -----
  991.          (re.d < *minp || re.d > *maxp))       ||
  992.   #ifndef GFLOAT
  993.         ((im.f.sign == 0 || re.f.exp != 0) &&
  994. + #else GFLOAT
  995. +       ((im.g.sign == 0 || re.g.exp != 0) &&
  996. + #endif GFLOAT
  997.          (im.d < *minp || re.d > *maxp)))
  998.       {
  999.         if (badvalue <= 1)
  1000. ***************
  1001. *** 624,629
  1002.         else
  1003.       {
  1004.         p = (expptr) mkconst(TYCOMPLEX);
  1005.         if (re.f.sign == 1 && re.f.exp == 0)
  1006.           re.q.word2 = 0;
  1007.         else
  1008.  
  1009. --- 795,801 -----
  1010.         else
  1011.       {
  1012.         p = (expptr) mkconst(TYCOMPLEX);
  1013. + #ifndef GFLOAT
  1014.         if (re.f.sign == 1 && re.f.exp == 0)
  1015.           re.q.word2 = 0;
  1016.         else
  1017. ***************
  1018. *** 643,648
  1019.         rp[1] = re.q.word2;
  1020.         rp[2] = im.q.word1;
  1021.         rp[3] = im.q.word2;
  1022.       }
  1023.         break;
  1024.   
  1025.  
  1026. --- 815,824 -----
  1027.         rp[1] = re.q.word2;
  1028.         rp[2] = im.q.word1;
  1029.         rp[3] = im.q.word2;
  1030. + #else GFLOAT
  1031. +           p->constblock.const.cr[0] = cp->const.cd[0];
  1032. +           p->constblock.const.cr[0] = cp->const.cd[1];
  1033. + #endif GFLOAT
  1034.       }
  1035.         break;
  1036.   
  1037. ***************
  1038. *** 711,716
  1039.         break;
  1040.   
  1041.       case TYREAL:
  1042.       case TYDREAL:
  1043.       case TYCOMPLEX:
  1044.       case TYDCOMPLEX:
  1045.  
  1046. --- 887,893 -----
  1047.         break;
  1048.   
  1049.       case TYREAL:
  1050. + #ifndef GFLOAT
  1051.       case TYDREAL:
  1052.   #endif GFLOAT
  1053.       case TYCOMPLEX:
  1054. ***************
  1055. *** 712,717
  1056.   
  1057.       case TYREAL:
  1058.       case TYDREAL:
  1059.       case TYCOMPLEX:
  1060.       case TYDCOMPLEX:
  1061.         p = (expptr) mkconst(TYDCOMPLEX);
  1062.  
  1063. --- 889,895 -----
  1064.       case TYREAL:
  1065.   #ifndef GFLOAT
  1066.       case TYDREAL:
  1067. + #endif GFLOAT
  1068.       case TYCOMPLEX:
  1069.   #ifdef GFLOAT
  1070.         p = (expptr) mkconst(TYDCOMPLEX);
  1071. ***************
  1072. *** 713,718
  1073.       case TYREAL:
  1074.       case TYDREAL:
  1075.       case TYCOMPLEX:
  1076.       case TYDCOMPLEX:
  1077.         p = (expptr) mkconst(TYDCOMPLEX);
  1078.         longp = (long *) &(cp->const.cd[0]);
  1079.  
  1080. --- 891,904 -----
  1081.       case TYDREAL:
  1082.   #endif GFLOAT
  1083.       case TYCOMPLEX:
  1084. + #ifdef GFLOAT
  1085. +       p = (expptr) mkconst(TYDCOMPLEX);
  1086. +       p->constblock.const.cd[0] = cp->const.cr[0];
  1087. +       p->constblock.const.cd[1] = cp->const.cr[1];
  1088. +       break;
  1089. +     case TYDREAL:
  1090. + #endif GFLOAT
  1091.       case TYDCOMPLEX:
  1092.         p = (expptr) mkconst(TYDCOMPLEX);
  1093.   #ifndef GFLOAT
  1094. ***************
  1095. *** 715,720
  1096.       case TYCOMPLEX:
  1097.       case TYDCOMPLEX:
  1098.         p = (expptr) mkconst(TYDCOMPLEX);
  1099.         longp = (long *) &(cp->const.cd[0]);
  1100.         rp = (long *) &(p->constblock.const.cd[0]);
  1101.         rp[0] = longp[0];
  1102.  
  1103. --- 901,907 -----
  1104.   #endif GFLOAT
  1105.       case TYDCOMPLEX:
  1106.         p = (expptr) mkconst(TYDCOMPLEX);
  1107. + #ifndef GFLOAT
  1108.         longp = (long *) &(cp->const.cd[0]);
  1109.         rp = (long *) &(p->constblock.const.cd[0]);
  1110.         rp[0] = longp[0];
  1111. ***************
  1112. *** 721,726
  1113.         rp[1] = longp[1];
  1114.         rp[2] = longp[2];
  1115.         rp[3] = longp[3];
  1116.         break;
  1117.   
  1118.       case TYLOGICAL:
  1119.  
  1120. --- 908,917 -----
  1121.         rp[1] = longp[1];
  1122.         rp[2] = longp[2];
  1123.         rp[3] = longp[3];
  1124. + #else GFLOAT
  1125. +       p->constblock.const.cd[0] = cp->const.cd[0];
  1126. +       p->constblock.const.cd[1] = cp->const.cd[1];
  1127. + #endif GFLOAT
  1128.         break;
  1129.   
  1130.       case TYLOGICAL:
  1131. SHAR_EOF
  1132. chmod +x 'conv.c.diff'
  1133. if test -f 'expr.c.diff'
  1134. then
  1135.     echo shar: over-writing existing file "'expr.c.diff'"
  1136. fi
  1137. cat << \SHAR_EOF > 'expr.c.diff'
  1138. *** ../f77/src/f77pass1/expr.c.orig    Tue Oct 29 15:15:54 1985
  1139. --- ../f77/src/f77pass1/expr.c    Tue Oct 29 15:22:42 1985
  1140. ***************
  1141. *** 151,157
  1142.   register Constp p;
  1143.   
  1144.   p = mkconst(t);
  1145. ! p->const.cd[0] = d;
  1146.   return( (expptr) p );
  1147.   }
  1148.   
  1149.  
  1150. --- 151,162 -----
  1151.   register Constp p;
  1152.   
  1153.   p = mkconst(t);
  1154. ! #ifdef GFLOAT
  1155. ! if (t==TYREAL)
  1156. !     p->const.cr[0] = d;
  1157. ! else
  1158. ! #endif GFLOAT
  1159. !     p->const.cd[0] = d;
  1160.   return( (expptr) p );
  1161.   }
  1162.   
  1163. ***************
  1164. *** 241,246
  1165.       p = mkconst( (rtype==TYDREAL||itype==TYDREAL) ? TYDCOMPLEX : TYCOMPLEX);
  1166.       if( ISINT(rtype) )
  1167.           p->const.cd[0] = realp->constblock.const.ci;
  1168.       else    p->const.cd[0] = realp->constblock.const.cd[0];
  1169.       if( ISINT(itype) )
  1170.           p->const.cd[1] = imagp->constblock.const.ci;
  1171.  
  1172. --- 246,255 -----
  1173.       p = mkconst( (rtype==TYDREAL||itype==TYDREAL) ? TYDCOMPLEX : TYCOMPLEX);
  1174.       if( ISINT(rtype) )
  1175.           p->const.cd[0] = realp->constblock.const.ci;
  1176. + #ifdef GFLOAT
  1177. +     else if (rtype==TYREAL || itype==TYREAL) 
  1178. +         p->const.cr[0] = realp->constblock.const.cr[0];
  1179. + #endif GFLOAT
  1180.       else    p->const.cd[0] = realp->constblock.const.cd[0];
  1181.       if( ISINT(itype) )
  1182.           p->const.cd[1] = imagp->constblock.const.ci;
  1183. ***************
  1184. *** 244,249
  1185.       else    p->const.cd[0] = realp->constblock.const.cd[0];
  1186.       if( ISINT(itype) )
  1187.           p->const.cd[1] = imagp->constblock.const.ci;
  1188.       else    p->const.cd[1] = imagp->constblock.const.cd[0];
  1189.       }
  1190.   else
  1191.  
  1192. --- 253,262 -----
  1193.       else    p->const.cd[0] = realp->constblock.const.cd[0];
  1194.       if( ISINT(itype) )
  1195.           p->const.cd[1] = imagp->constblock.const.ci;
  1196. + #ifdef GFLOAT
  1197. +     else if (rtype==TYREAL || itype==TYREAL) 
  1198. +         p->const.cr[1] = imagp->constblock.const.cr[0];
  1199. + #endif GFLOAT
  1200.       else    p->const.cd[1] = imagp->constblock.const.cd[0];
  1201.       }
  1202.   else
  1203. ***************
  1204. *** 2255,2261
  1205.               lv->ci = rv->ccp[0];
  1206.           else if( ISINT(rt) )
  1207.               lv->ci = rv->ci;
  1208. !         else    lv->ci = rv->cd[0];
  1209.           break;
  1210.   
  1211.       case TYCOMPLEX:
  1212.  
  1213. --- 2268,2278 -----
  1214.               lv->ci = rv->ccp[0];
  1215.           else if( ISINT(rt) )
  1216.               lv->ci = rv->ci;
  1217. ! #ifdef GFLOAT
  1218. !         else if (rt==TYREAL || rt==TYCOMPLEX)
  1219. !                    lv->ci = rv->cr[0]; /* should test */
  1220. ! #endif GFLOAT
  1221. !           else    lv->ci = rv->cd[0];
  1222.           break;
  1223.   
  1224.       case TYCOMPLEX: 
  1225. ***************
  1226. *** 2258,2264
  1227.           else    lv->ci = rv->cd[0];
  1228.           break;
  1229.   
  1230. !     case TYCOMPLEX:
  1231.       case TYDCOMPLEX:
  1232.           switch(rt)
  1233.               {
  1234.  
  1235. --- 2275,2305 -----
  1236.             else    lv->ci = rv->cd[0];
  1237.           break;
  1238.   
  1239. !     case TYCOMPLEX: 
  1240. ! #ifdef GFLOAT
  1241. !         switch(rt)
  1242. !             {
  1243. !             case TYSHORT:
  1244. !             case TYLONG:
  1245. !                 /* fall through and do real assignment of
  1246. !                    first element */
  1247. !             case TYREAL:
  1248. !             case TYDREAL:
  1249. !                 lv->cr[1] = 0; break;
  1250. !             case TYCOMPLEX:
  1251. !                 lv->cr[1] = rv->cr[1]; break;
  1252. !             case TYDCOMPLEX: /* should check range here */
  1253. !                 lv->cr[1] = rv->cd[1]; break;
  1254. !             }
  1255. !     case TYREAL:
  1256. !         if( ISINT(rt) )
  1257. !             lv->cr[0] = rv->ci;
  1258. !         else if (rt==TYREAL || rt==TYCOMPLEX) 
  1259. !             lv->cr[0] = rv->cr[0];
  1260. !         else    lv->cr[0] = rv->cd[0]; /* should test range */
  1261. !         break;
  1262. ! #endif GFLOAT
  1263.       case TYDCOMPLEX:
  1264.           switch(rt)
  1265.               {
  1266. ***************
  1267. *** 2270,2276
  1268.               case TYREAL:
  1269.               case TYDREAL:
  1270.                   lv->cd[1] = 0; break;
  1271. !             case TYCOMPLEX:
  1272.               case TYDCOMPLEX:
  1273.                   lv->cd[1] = rv->cd[1]; break;
  1274.               }
  1275.  
  1276. --- 2311,2320 -----
  1277.               case TYREAL:
  1278.               case TYDREAL:
  1279.                   lv->cd[1] = 0; break;
  1280. !             case TYCOMPLEX: 
  1281. ! #ifdef GFLOAT
  1282. !                 lv->cd[1] = rv->cr[1]; break;
  1283. ! #endif GFLOAT
  1284.               case TYDCOMPLEX:
  1285.                   lv->cd[1] = rv->cd[1]; break;
  1286.               }
  1287. ***************
  1288. *** 2274,2280
  1289.               case TYDCOMPLEX:
  1290.                   lv->cd[1] = rv->cd[1]; break;
  1291.               }
  1292.       case TYREAL:
  1293.       case TYDREAL:
  1294.           if( ISINT(rt) )
  1295.  
  1296. --- 2318,2324 -----
  1297.               case TYDCOMPLEX:
  1298.                   lv->cd[1] = rv->cd[1]; break;
  1299.               }
  1300. ! #ifndef GFLOAT
  1301.       case TYREAL:
  1302.   #endif GFLOAT
  1303.       case TYDREAL:
  1304. ***************
  1305. *** 2276,2281
  1306.               }
  1307.   
  1308.       case TYREAL:
  1309.       case TYDREAL:
  1310.           if( ISINT(rt) )
  1311.               lv->cd[0] = rv->ci;
  1312.  
  1313. --- 2320,2326 -----
  1314.               }
  1315.   #ifndef GFLOAT
  1316.       case TYREAL:
  1317. + #endif GFLOAT
  1318.       case TYDREAL:
  1319.           if( ISINT(rt) )
  1320.               lv->cd[0] = rv->ci;
  1321. ***************
  1322. *** 2279,2284
  1323.       case TYDREAL:
  1324.           if( ISINT(rt) )
  1325.               lv->cd[0] = rv->ci;
  1326.           else    lv->cd[0] = rv->cd[0];
  1327.           break;
  1328.   
  1329.  
  1330. --- 2324,2333 -----
  1331.       case TYDREAL:
  1332.           if( ISINT(rt) )
  1333.               lv->cd[0] = rv->ci;
  1334. + #ifdef GFLOAT
  1335. +         else if (rt==TYREAL || rt==TYCOMPLEX) 
  1336. +             lv->cd[0] = rv->cr[0];
  1337. + #endif GFLOAT
  1338.           else    lv->cd[0] = rv->cd[0];
  1339.           break;
  1340.   
  1341. ***************
  1342. *** 2300,2306
  1343.           p->const.ci = - p->const.ci;
  1344.           break;
  1345.   
  1346. !     case TYCOMPLEX:
  1347.       case TYDCOMPLEX:
  1348.           p->const.cd[1] = - p->const.cd[1];
  1349.           /* fall through and do the real parts */
  1350.  
  1351. --- 2349,2362 -----
  1352.           p->const.ci = - p->const.ci;
  1353.           break;
  1354.   
  1355. !     case TYCOMPLEX: 
  1356. ! #ifdef GFLOAT
  1357. !         p->const.cr[1] = - p->const.cr[1];
  1358. !         /* fall through and do the real parts */
  1359. !     case TYREAL:
  1360. !         p->const.cr[0] = - p->const.cr[0];
  1361. !         break;
  1362. ! #endif GFLOAT
  1363.       case TYDCOMPLEX:
  1364.           p->const.cd[1] = - p->const.cd[1];
  1365.           /* fall through and do the real parts */
  1366. ***************
  1367. *** 2304,2309
  1368.       case TYDCOMPLEX:
  1369.           p->const.cd[1] = - p->const.cd[1];
  1370.           /* fall through and do the real parts */
  1371.       case TYREAL:
  1372.       case TYDREAL:
  1373.           p->const.cd[0] = - p->const.cd[0];
  1374.  
  1375. --- 2360,2366 -----
  1376.       case TYDCOMPLEX:
  1377.           p->const.cd[1] = - p->const.cd[1];
  1378.           /* fall through and do the real parts */
  1379. + #ifndef GFLOAT
  1380.       case TYREAL:
  1381.   #endif GFLOAT
  1382.       case TYDREAL:
  1383. ***************
  1384. *** 2305,2310
  1385.           p->const.cd[1] = - p->const.cd[1];
  1386.           /* fall through and do the real parts */
  1387.       case TYREAL:
  1388.       case TYDREAL:
  1389.           p->const.cd[0] = - p->const.cd[0];
  1390.           break;
  1391.  
  1392. --- 2362,2368 -----
  1393.           /* fall through and do the real parts */
  1394.   #ifndef GFLOAT
  1395.       case TYREAL:
  1396. + #endif GFLOAT
  1397.       case TYDREAL:
  1398.           p->const.cd[0] = - p->const.cd[0];
  1399.           break;
  1400. ***************
  1401. *** 2329,2335
  1402.       case TYLONG:
  1403.           powp->ci = 1;
  1404.           break;
  1405. !     case TYCOMPLEX:
  1406.       case TYDCOMPLEX:
  1407.           powp->cd[1] = 0;
  1408.       case TYREAL:
  1409.  
  1410. --- 2387,2399 -----
  1411.       case TYLONG:
  1412.           powp->ci = 1;
  1413.           break;
  1414. !     case TYCOMPLEX: 
  1415. ! #ifdef GFLOAT
  1416. !         powp->cr[1] = 0;
  1417. !     case TYREAL:
  1418. !         powp->cr[0] = 1;
  1419. !         break;
  1420. ! #endif GFLOAT
  1421.       case TYDCOMPLEX:
  1422.           powp->cd[1] = 0;
  1423.   #ifndef GFLOAT
  1424. ***************
  1425. *** 2332,2337
  1426.       case TYCOMPLEX:
  1427.       case TYDCOMPLEX:
  1428.           powp->cd[1] = 0;
  1429.       case TYREAL:
  1430.       case TYDREAL:
  1431.           powp->cd[0] = 1;
  1432.  
  1433. --- 2396,2402 -----
  1434.   #endif GFLOAT
  1435.       case TYDCOMPLEX:
  1436.           powp->cd[1] = 0;
  1437. + #ifndef GFLOAT
  1438.       case TYREAL:
  1439.   #endif GFLOAT
  1440.       case TYDREAL:
  1441. ***************
  1442. *** 2333,2338
  1443.       case TYDCOMPLEX:
  1444.           powp->cd[1] = 0;
  1445.       case TYREAL:
  1446.       case TYDREAL:
  1447.           powp->cd[0] = 1;
  1448.           break;
  1449.  
  1450. --- 2398,2404 -----
  1451.           powp->cd[1] = 0;
  1452.   #ifndef GFLOAT
  1453.       case TYREAL:
  1454. + #endif GFLOAT
  1455.       case TYDREAL:
  1456.           powp->cd[0] = 1;
  1457.           break;
  1458. ***************
  1459. *** 2383,2388
  1460.   
  1461.   /* do constant operation cp = a op b */
  1462.   
  1463.   
  1464.   LOCAL consbinop(opcode, type, cp, ap, bp)
  1465.   int opcode, type;
  1466.  
  1467. --- 2449,2457 -----
  1468.   
  1469.   /* do constant operation cp = a op b */
  1470.   
  1471. + #ifdef GFLOAT
  1472. + struct rcomplex { double real, imag; };
  1473. + #endif GFLOAT
  1474.   
  1475.   LOCAL consbinop(opcode, type, cp, ap, bp)
  1476.   int opcode, type;
  1477. ***************
  1478. *** 2390,2395
  1479.   {
  1480.   int k;
  1481.   double temp;
  1482.   
  1483.   switch(opcode)
  1484.       {
  1485.  
  1486. --- 2459,2467 -----
  1487.   {
  1488.   int k;
  1489.   double temp;
  1490. + #ifdef GFLOAT
  1491. + struct rcomplex fr, ar, br;
  1492. + #endif GFLOAT
  1493.   
  1494.   switch(opcode)
  1495.       {
  1496. ***************
  1497. *** 2401,2406
  1498.                   cp->ci = ap->ci + bp->ci;
  1499.                   break;
  1500.               case TYCOMPLEX:
  1501.               case TYDCOMPLEX:
  1502.                   cp->cd[1] = ap->cd[1] + bp->cd[1];
  1503.               case TYREAL:
  1504.  
  1505. --- 2473,2484 -----
  1506.                   cp->ci = ap->ci + bp->ci;
  1507.                   break;
  1508.               case TYCOMPLEX:
  1509. + #ifdef GFLOAT
  1510. +                 cp->cr[1] = ap->cr[1] + bp->cr[1];
  1511. +             case TYREAL:
  1512. +                 cp->cr[0] = ap->cr[0] + bp->cr[0];
  1513. +                 break;
  1514. + #endif GFLOAT
  1515.               case TYDCOMPLEX:
  1516.                   cp->cd[1] = ap->cd[1] + bp->cd[1];
  1517.   #ifndef GFLOAT
  1518. ***************
  1519. *** 2403,2408
  1520.               case TYCOMPLEX:
  1521.               case TYDCOMPLEX:
  1522.                   cp->cd[1] = ap->cd[1] + bp->cd[1];
  1523.               case TYREAL:
  1524.               case TYDREAL:
  1525.                   cp->cd[0] = ap->cd[0] + bp->cd[0];
  1526.  
  1527. --- 2481,2487 -----
  1528.   #endif GFLOAT
  1529.               case TYDCOMPLEX:
  1530.                   cp->cd[1] = ap->cd[1] + bp->cd[1];
  1531. + #ifndef GFLOAT
  1532.               case TYREAL:
  1533.   #endif GFLOAT
  1534.               case TYDREAL:
  1535. ***************
  1536. *** 2404,2409
  1537.               case TYDCOMPLEX:
  1538.                   cp->cd[1] = ap->cd[1] + bp->cd[1];
  1539.               case TYREAL:
  1540.               case TYDREAL:
  1541.                   cp->cd[0] = ap->cd[0] + bp->cd[0];
  1542.                   break;
  1543.  
  1544. --- 2483,2489 -----
  1545.                   cp->cd[1] = ap->cd[1] + bp->cd[1];
  1546.   #ifndef GFLOAT
  1547.               case TYREAL:
  1548. + #endif GFLOAT
  1549.               case TYDREAL:
  1550.                   cp->cd[0] = ap->cd[0] + bp->cd[0];
  1551.                   break;
  1552. ***************
  1553. *** 2417,2423
  1554.               case TYLONG:
  1555.                   cp->ci = ap->ci - bp->ci;
  1556.                   break;
  1557. !             case TYCOMPLEX:
  1558.               case TYDCOMPLEX:
  1559.                   cp->cd[1] = ap->cd[1] - bp->cd[1];
  1560.               case TYREAL:
  1561.  
  1562. --- 2497,2509 -----
  1563.               case TYLONG:
  1564.                   cp->ci = ap->ci - bp->ci;
  1565.                   break;
  1566. !             case TYCOMPLEX: 
  1567. ! #ifdef GFLOAT
  1568. !                 cp->cr[1] = ap->cr[1] - bp->cr[1];
  1569. !             case TYREAL:
  1570. !                 cp->cr[0] = ap->cr[0] - bp->cr[0];
  1571. !                 break;
  1572. ! #endif GFLOAT
  1573.               case TYDCOMPLEX:
  1574.                   cp->cd[1] = ap->cd[1] - bp->cd[1];
  1575.   #ifndef GFLOAT
  1576. ***************
  1577. *** 2420,2425
  1578.               case TYCOMPLEX:
  1579.               case TYDCOMPLEX:
  1580.                   cp->cd[1] = ap->cd[1] - bp->cd[1];
  1581.               case TYREAL:
  1582.               case TYDREAL:
  1583.                   cp->cd[0] = ap->cd[0] - bp->cd[0];
  1584.  
  1585. --- 2506,2512 -----
  1586.   #endif GFLOAT
  1587.               case TYDCOMPLEX:
  1588.                   cp->cd[1] = ap->cd[1] - bp->cd[1];
  1589. + #ifndef GFLOAT
  1590.               case TYREAL:
  1591.   #endif GFLOAT
  1592.               case TYDREAL:
  1593. ***************
  1594. *** 2421,2426
  1595.               case TYDCOMPLEX:
  1596.                   cp->cd[1] = ap->cd[1] - bp->cd[1];
  1597.               case TYREAL:
  1598.               case TYDREAL:
  1599.                   cp->cd[0] = ap->cd[0] - bp->cd[0];
  1600.                   break;
  1601.  
  1602. --- 2508,2514 -----
  1603.                   cp->cd[1] = ap->cd[1] - bp->cd[1];
  1604.   #ifndef GFLOAT
  1605.               case TYREAL:
  1606. + #endif GFLOAT
  1607.               case TYDREAL:
  1608.                   cp->cd[0] = ap->cd[0] - bp->cd[0];
  1609.                   break;
  1610. ***************
  1611. *** 2434,2440
  1612.               case TYLONG:
  1613.                   cp->ci = ap->ci * bp->ci;
  1614.                   break;
  1615. !             case TYREAL:
  1616.               case TYDREAL:
  1617.                   cp->cd[0] = ap->cd[0] * bp->cd[0];
  1618.                   break;
  1619.  
  1620. --- 2522,2532 -----
  1621.               case TYLONG:
  1622.                   cp->ci = ap->ci * bp->ci;
  1623.                   break;
  1624. !             case TYREAL: 
  1625. ! #ifdef GFLOAT
  1626. !                 cp->cr[0] = ap->cr[0] * bp->cr[0];
  1627. !                 break;
  1628. ! #endif GFLOAT
  1629.               case TYDREAL:
  1630.                   cp->cd[0] = ap->cd[0] * bp->cd[0];
  1631.                   break;
  1632. ***************
  1633. *** 2439,2444
  1634.                   cp->cd[0] = ap->cd[0] * bp->cd[0];
  1635.                   break;
  1636.               case TYCOMPLEX:
  1637.               case TYDCOMPLEX:
  1638.                   temp = ap->cd[0] * bp->cd[0] -
  1639.                           ap->cd[1] * bp->cd[1] ;
  1640.  
  1641. --- 2531,2544 -----
  1642.                   cp->cd[0] = ap->cd[0] * bp->cd[0];
  1643.                   break;
  1644.               case TYCOMPLEX:
  1645. + #ifdef GFLOAT
  1646. +                 temp = ap->cr[0] * bp->cr[0] -
  1647. +                         ap->cr[1] * bp->cr[1] ;
  1648. +                 cp->cr[1] = ap->cr[0] * bp->cr[1] +
  1649. +                         ap->cr[1] * bp->cr[0] ;
  1650. +                 cp->cr[0] = temp;
  1651. +                 break;
  1652. + #endif GFLOAT
  1653.               case TYDCOMPLEX:
  1654.                   temp = ap->cd[0] * bp->cd[0] -
  1655.                           ap->cd[1] * bp->cd[1] ;
  1656. ***************
  1657. *** 2455,2461
  1658.               case TYLONG:
  1659.                   cp->ci = ap->ci / bp->ci;
  1660.                   break;
  1661. !             case TYREAL:
  1662.               case TYDREAL:
  1663.                   cp->cd[0] = ap->cd[0] / bp->cd[0];
  1664.                   break;
  1665.  
  1666. --- 2555,2565 -----
  1667.               case TYLONG:
  1668.                   cp->ci = ap->ci / bp->ci;
  1669.                   break;
  1670. !             case TYREAL: 
  1671. ! #ifdef GFLOAT
  1672. !                 cp->cr[0] = ap->cr[0] / bp->cr[0];
  1673. !                 break;
  1674. ! #endif GFLOAT
  1675.               case TYDREAL:
  1676.                   cp->cd[0] = ap->cd[0] / bp->cd[0];
  1677.                   break;
  1678. ***************
  1679. *** 2460,2465
  1680.                   cp->cd[0] = ap->cd[0] / bp->cd[0];
  1681.                   break;
  1682.               case TYCOMPLEX:
  1683.               case TYDCOMPLEX:
  1684.                   zdiv(cp,ap,bp);
  1685.                   break;
  1686.  
  1687. --- 2564,2579 -----
  1688.                   cp->cd[0] = ap->cd[0] / bp->cd[0];
  1689.                   break;
  1690.               case TYCOMPLEX:
  1691. + #ifdef GFLOAT
  1692. +                 ar.real = ap->cr[0];
  1693. +                  ar.imag = ap->cr[1];
  1694. +                 br.real = bp->cr[0];
  1695. +                 br.imag = bp->cr[1];
  1696. +                 zdiv(fr,ar,br);
  1697. +                 cp->cr[0] = fr.real; /* should test */
  1698. +                 cp->cr[1] = fr.imag;
  1699. +                 break;
  1700. + #endif GFLOAT
  1701.               case TYDCOMPLEX:
  1702.                   zdiv(cp,ap,bp);
  1703.                   break;
  1704. ***************
  1705. *** 2486,2492
  1706.                       k = 0;
  1707.                   else    k = 1;
  1708.                   break;
  1709. !             case TYREAL:
  1710.               case TYDREAL:
  1711.                   if(ap->cd[0] < bp->cd[0])
  1712.                       k = -1;
  1713.  
  1714. --- 2600,2606 -----
  1715.                       k = 0;
  1716.                   else    k = 1;
  1717.                   break;
  1718. !             case TYREAL: /*assume this works for G format floats */
  1719.               case TYDREAL:
  1720.                   if(ap->cd[0] < bp->cd[0])
  1721.                       k = -1;
  1722. ***************
  1723. *** 2494,2500
  1724.                       k = 0;
  1725.                   else    k = 1;
  1726.                   break;
  1727. !             case TYCOMPLEX:
  1728.               case TYDCOMPLEX:
  1729.                   if(ap->cd[0] == bp->cd[0] &&
  1730.                      ap->cd[1] == bp->cd[1] )
  1731.  
  1732. --- 2608,2621 -----
  1733.                       k = 0;
  1734.                   else    k = 1;
  1735.                   break;
  1736. !             case TYCOMPLEX: 
  1737. ! #ifdef GFLOAT
  1738. !                 if(ap->cr[0] == bp->cr[0] &&
  1739. !                    ap->cr[1] == bp->cr[1] )
  1740. !                     k = 0;
  1741. !                 else    k = 1;
  1742. !                 break;
  1743. ! #endif GFLOAT
  1744.               case TYDCOMPLEX:
  1745.                   if(ap->cd[0] == bp->cd[0] &&
  1746.                      ap->cd[1] == bp->cd[1] )
  1747. ***************
  1748. *** 2547,2553
  1749.           if(p->constblock.const.ci < 0) return(-1);
  1750.           return(0);
  1751.   
  1752. !     case TYREAL:
  1753.       case TYDREAL:
  1754.           if(p->constblock.const.cd[0] > 0) return(1);
  1755.           if(p->constblock.const.cd[0] < 0) return(-1);
  1756.  
  1757. --- 2668,2679 -----
  1758.           if(p->constblock.const.ci < 0) return(-1);
  1759.           return(0);
  1760.   
  1761. !     case TYREAL: 
  1762. ! #ifdef GFLOAT
  1763. !         if(p->constblock.const.cr[0] > 0) return(1);
  1764. !         if(p->constblock.const.cr[0] < 0) return(-1);
  1765. !         return(0);
  1766. ! #endif GFLOAT
  1767.       case TYDREAL:
  1768.           if(p->constblock.const.cd[0] > 0) return(1);
  1769.           if(p->constblock.const.cd[0] < 0) return(-1);
  1770. ***************
  1771. *** 2553,2559
  1772.           if(p->constblock.const.cd[0] < 0) return(-1);
  1773.           return(0);
  1774.   
  1775. !     case TYCOMPLEX:
  1776.       case TYDCOMPLEX:
  1777.           return(p->constblock.const.cd[0]!=0 || p->constblock.const.cd[1]!=0);
  1778.   
  1779.  
  1780. --- 2679,2687 -----
  1781.           if(p->constblock.const.cd[0] < 0) return(-1);
  1782.           return(0);
  1783.   
  1784. !     case TYCOMPLEX: 
  1785. ! #ifdef GFLOAT
  1786. !     return(p->constblock.const.cr[0]!=0 || p->constblock.const.cr[1]!=0);
  1787.       case TYDCOMPLEX:
  1788.       return(p->constblock.const.cd[0]!=0 || p->constblock.const.cd[1]!=0);
  1789.   #else GFLOAT
  1790. ***************
  1791. *** 2555,2561
  1792.   
  1793.       case TYCOMPLEX:
  1794.       case TYDCOMPLEX:
  1795. !         return(p->constblock.const.cd[0]!=0 || p->constblock.const.cd[1]!=0);
  1796.   
  1797.       default:
  1798.           badtype( "conssgn", p->constblock.vtype);
  1799.  
  1800. --- 2683,2693 -----
  1801.   #ifdef GFLOAT
  1802.       return(p->constblock.const.cr[0]!=0 || p->constblock.const.cr[1]!=0);
  1803.       case TYDCOMPLEX:
  1804. !     return(p->constblock.const.cd[0]!=0 || p->constblock.const.cd[1]!=0);
  1805. ! #else GFLOAT
  1806. !     case TYDCOMPLEX:
  1807. !     return(p->constblock.const.cd[0]!=0 || p->constblock.const.cd[1]!=0);
  1808. ! #endif GFLOAT
  1809.   
  1810.       default:
  1811.           badtype( "conssgn", p->constblock.vtype);
  1812. SHAR_EOF
  1813. chmod +x 'expr.c.diff'
  1814. if test -f 'defs.h.diff'
  1815. then
  1816.     echo shar: over-writing existing file "'defs.h.diff'"
  1817. fi
  1818. cat << \SHAR_EOF > 'defs.h.diff'
  1819. *** ../f77/src/f77pass1/defs.h.orig    Tue Oct 29 15:15:49 1985
  1820. --- ../f77/src/f77pass1/defs.h    Tue Oct 29 15:22:31 1985
  1821. ***************
  1822. *** 367,372
  1823.       char *ccp;
  1824.       ftnint ci;
  1825.       double cd[2];
  1826.       };
  1827.   
  1828.   struct Constblock
  1829.  
  1830. --- 367,375 -----
  1831.       char *ccp;
  1832.       ftnint ci;
  1833.       double cd[2];
  1834. + #ifdef GFLOAT
  1835. +         float cr[4];
  1836. + #endif GFLOAT
  1837.       };
  1838.   
  1839.   struct Constblock
  1840. SHAR_EOF
  1841. chmod +x 'defs.h.diff'
  1842. chdir ..
  1843. chdir ..
  1844. chdir ..
  1845. chdir ..
  1846. #    End of shell archive
  1847. exit 0
  1848.  
  1849.